<?php
 header('content-type:text/html;charset=utf-8'); 
	$lot=$_GET["lot"];
	$dbName = "sqlsrv:Server=172.31.3.12,1433;Database=UFDATA_001_2017";   //emc3030
	$dbUser = "sa";    //
	$dbPassword = "TDled!2018";    //
	$db = new PDO($dbName, $dbUser, $dbPassword);   
	//$sql = "select MoId from  mom_order where MoCode ='".$lot."' ";
	//print_r($sql);
	//$res = $db->query($sql);
	//print_r($res);
	// while ($row = $res->fetch()){
	//	print_r($MoDId=$row['MoId']);
	//}	
	//2018-3-13 12:52:27注釋:原語句備份$sql = "select MoDId,InvCode from mom_orderdetail where moid=(select MoId from  mom_order where MoCode ='".$lot."') ";  //
	//print_r($sql);
	$sql =
		"SELECT 
			cInvCode,
			cInvName,
			cInvDefine1,
			cInvDefine2,
			cInvDefine3,
			cInvDefine10
		FROM 
			Inventory
		WHERE 
			cInvCode ='".$lot."'"
	;
	//print_r($sql);
	$res = $db->query($sql);
	//print_r($res);
	$ChLiaoHao="";
	$ChGuiGe="";
	$ChChiCun="";
	$ChWD="";
	$ChPO="";
	$ChVf="";
	//$row = null;
	 while ($row = $res->fetch()){
		$ChLiaoHao=$row['cInvCode'];
		$ChGuiGe=$row['cInvName'];
		$ChChiCun=$row['cInvDefine1'];
		$ChWD=$row['cInvDefine2'];
		$ChPO=$row['cInvDefine3'];
		$ChVf=$row['cInvDefine10'];
	}
	$res = null;
	$db = null;
	$co= $ChLiaoHao.",".$ChGuiGe.",".$ChChiCun.",".$ChWD.",".$ChPO.",".$ChVf;
	//A2713F0,晶片/S-35EBMUP-A(E),22*35mil,452.5-455,220-230,2.9-3.2
	print_r($co);
?>